//
//  YJSenceListView.m
//  SnackCourier
//
//  Created by qianfeng01 on 15/7/20.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "YJSenceListView.h"
#import "UIImageView+WebCache.h"

@interface YJSenceListView ()

@property (nonatomic,weak) id target;
@property (nonatomic,assign) SEL action;

@end

@implementation YJSenceListView

-(void)addTarget:(id)target action:(SEL)action{
    self.target=target;
    self.action=action;
}

//手指离开当前视图的时候
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    //忽略SEL 产生的警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    
    if ([self.target respondsToSelector:self.action]) {
        [self.target performSelector:self.action withObject:self];
    }
#pragma clang diagnostic pop
}

-(void)showDataWithModel:(YJSenceListModel *)model{
    [self.picUrlimageView sd_setImageWithURL:[NSURL URLWithString:model.picUrl]];
}


@end
